package com.tobestronger.shouxiespringframework.beans.factory.support;


import com.tobestronger.shouxiespringframework.beans.BeansException;
import com.tobestronger.shouxiespringframework.core.io.Resource;
import com.tobestronger.shouxiespringframework.core.io.ResourceLoader;

/**
 * Bean定义 读取器简单接口定义
 */
public interface BeanDefinitionReader {

    /**
     * 获取Bean定义注册表
     * @return
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * 获取资源加载器
     * @return
     */
    ResourceLoader getResourceLoader();

    /**
     * 从指定资源中加载bean定义信息
     *
     * @param resource
     * @throws BeansException
     */
    void loadBeanDefinitions(Resource resource) throws BeansException;

    /**
     * 从多个资源中加载bean定义信息
     *
     * @param resources
     * @throws BeansException
     */
    void loadBeanDefinitions(Resource... resources) throws BeansException;

    /**
     * 从指定位置中加载bean定义信息
     *
     * @param location
     * @throws BeansException
     */
    void loadBeanDefinitions(String location) throws BeansException;

    /**
     * 从多个位置中加载bean定义信息
     *
     * @param locations
     * @throws BeansException
     */
    void loadBeanDefinitions(String... locations) throws BeansException;

}
